package com.usian.controller;

import com.usian.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {

    @Autowired
    private StockService stockService;

    /**
     * 扣减库存
     *
     * @param skuId
     * @param num
     * @return
     */
    @RequestMapping("/jian/{skuId}/{num}")
    public boolean jian(@PathVariable Integer skuId,@PathVariable Integer num){
        return stockService.jian(skuId,num);
    }
}
